/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Magis.java
 *
 * Created on Feb 16, 2009, 12:25:02 PM
 */

package magis;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.GUID;
import edu.byu.intex2.data.Model;
import edu.byu.intex2.data.bo.Customer;
import edu.byu.intex2.data.bo.Employee;
import edu.byu.intex2.data.bo.Salesperson;
import edu.byu.intex2.data.dao.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Brady
 */
public class Magis1 extends javax.swing.JFrame {

    DefaultListModel customerListModel = new DefaultListModel();
    DefaultListModel serviceListModel = new DefaultListModel();
    Boolean editState = false;
    List<Customer> custList = CustomerDAO.getInstance().getAll();
    List<JButton> serviceItemList = new ArrayList();
    int ServiceItemCounter = 1;
    String ServiceButtonSelected = "";
    JButton tempButton;

    /** Creates new form Magis */
    public Magis1() throws DataException {

        
        initComponents();
        
        this.setEditState();
        //TODO get all the customers and put them in the default list model for the JList
        this.reloadCustomerList();
        customerList.setModel(customerListModel);
        
        
    }
    public void setEditState(){
        fname_txt.setEditable(editState);
        lname_txt.setEditable(editState);
        address_txt.setEditable(editState);
        phone_tx.setEditable(editState);
        highPrice_txt.setEditable(editState);
        lowPrice_txt.setEditable(editState);
    }
    public void clearEditFields(){
        fname_txt.setText("");
        lname_txt.setText("");
        address_txt.setText("");
        phone_tx.setText("");
        highPrice_txt.setText("");
        lowPrice_txt.setText("");
    }
    public void reloadCustomerList() throws DataException{
        
        customerListModel.clear();
        for(int i=0;i < custList.size(); i++){
            customerListModel.addElement(custList.get(i).getFullName());
        }
    }
    public void reloadServiceList() throws DataException{
        serviceListModel.clear();
    }
    public void setCustomerFields(Customer cust){
        fname_txt.setText(cust.getFirstName());
        lname_txt.setText(cust.getLastName());
        address_txt.setText(cust.getAddress());
        phone_tx.setText(cust.getPhone());
        highPrice_txt.setText(cust.getHighPrice() + "");
        lowPrice_txt.setText(cust.getLowPrice() + "");
        custName.setText(Model.getInstance().customer.getFullName());
        custPhone_lbl.setText(Model.getInstance().customer.getPhone());
    }
    public void setEmployeeFields(Employee emp){
        spWelcome_lbl.setText(Model.getInstance().employee.getFullName());
        spName_lbl.setText(Model.getInstance().employee.getFullName());        
    }

    public void addServiceListItems(){
        summaryPanel_pnl.removeAll();
        for(int i = 0; i < serviceItemList.size(); i++){
            summaryPanel_pnl.add(serviceItemList.get(i));
        }
    }

    
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        popupMenu1 = new java.awt.PopupMenu();
        header_pnl = new javax.swing.JPanel();
        magis_lbl = new javax.swing.JLabel();
        section_lbl = new javax.swing.JLabel();
        welcom_lbl = new javax.swing.JLabel();
        spWelcome_lbl = new javax.swing.JLabel();
        tabNavigation = new javax.swing.JTabbedPane();
        customerTab_pnl = new javax.swing.JPanel();
        customerList_pnl = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        customerList = new javax.swing.JList();
        custSearchGroup = new javax.swing.JPanel();
        salePrice_txt = new javax.swing.JTextField();
        addTradeIn_btn1 = new javax.swing.JButton();
        addCustomer_btn = new javax.swing.JButton();
        custInfo_pnl = new javax.swing.JPanel();
        fname_lbl = new javax.swing.JLabel();
        fname_txt = new javax.swing.JFormattedTextField();
        lname_lbl = new javax.swing.JLabel();
        lname_txt = new javax.swing.JFormattedTextField();
        address_lbl = new javax.swing.JLabel();
        address_txt = new javax.swing.JFormattedTextField();
        phone_lbl = new javax.swing.JLabel();
        phone_tx = new javax.swing.JFormattedTextField();
        highPrice_lbl = new javax.swing.JLabel();
        highPrice_txt = new javax.swing.JFormattedTextField();
        lowPrice_lbl = new javax.swing.JLabel();
        lowPrice_txt = new javax.swing.JFormattedTextField();
        saveCustomer_btn = new javax.swing.JButton();
        editCustomer_btn = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        makeSale_btn = new javax.swing.JButton();
        saleTab_pnl = new javax.swing.JPanel();
        carsAndTradeIns = new javax.swing.JPanel();
        tradeInsGroup = new javax.swing.JPanel();
        tradeIns_sp = new javax.swing.JScrollPane();
        tradeIns_tbl = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        removeTradeIn_btn = new javax.swing.JButton();
        addTradeIn_btn2 = new javax.swing.JButton();
        saleCarsGroup = new javax.swing.JPanel();
        saleCars_sp = new javax.swing.JScrollPane();
        saleCars_tbl = new javax.swing.JTable();
        saleLinesMenu = new javax.swing.JPanel();
        addViewWarranty_btn = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        removeCar_btn = new javax.swing.JButton();
        addCar_btn = new javax.swing.JButton();
        custAndSalesperson = new javax.swing.JPanel();
        customerGroup = new javax.swing.JPanel();
        custName = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        custPhone_lbl = new javax.swing.JLabel();
        salespersonGroup = new javax.swing.JPanel();
        spName_lbl = new javax.swing.JLabel();
        selectSalesperson_btn = new javax.swing.JButton();
        spId_lbl = new javax.swing.JLabel();
        saleMenu = new javax.swing.JPanel();
        cancel_btn = new javax.swing.JButton();
        saveSale_btn = new javax.swing.JButton();
        salesTotal = new javax.swing.JPanel();
        saleTotals_scrollPane = new javax.swing.JScrollPane();
        saleTotals_jtable = new javax.swing.JTable();
        serviceTab_pnl = new javax.swing.JPanel();
        custAndTech_pnl = new javax.swing.JPanel();
        custService_Info = new javax.swing.JPanel();
        custService_lbl = new javax.swing.JLabel();
        custServicePhone_lbl = new javax.swing.JLabel();
        changeServiceCust_lbl = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        techInfo_pnl = new javax.swing.JPanel();
        techName_lbl = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        saleMenu1 = new javax.swing.JPanel();
        cancelService_btn = new javax.swing.JButton();
        saveService_btn = new javax.swing.JButton();
        vehicleAndTask = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        custVehicleSelect_cbo = new javax.swing.JComboBox();
        summaryPanel_pnl = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        jComboBox1 = new javax.swing.JComboBox();
        jButton4 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jTextField5 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jComboBox2 = new javax.swing.JComboBox();
        jButton8 = new javax.swing.JButton();
        jLabel25 = new javax.swing.JLabel();
        jTextField7 = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        carDisplay_pnl = new javax.swing.JPanel();
        custCarMakeDisplay_lbl = new javax.swing.JLabel();
        custCarVin_lbl = new javax.swing.JLabel();
        custCarYearDisplay_lbl = new javax.swing.JLabel();
        custCarMake_lbl = new javax.swing.JLabel();
        custCarYear_lbl = new javax.swing.JLabel();
        custCarModelDisplay_lbl = new javax.swing.JLabel();
        custCarModel_lbl = new javax.swing.JLabel();
        custCarVinDisplay_lbl = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        serviceTaskSelect_cbo = new javax.swing.JComboBox();
        jButton3 = new javax.swing.JButton();
        grand_total_pnl = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();

        popupMenu1.setLabel("popupMenu1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(750, 800));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        magis_lbl.setFont(new java.awt.Font("Tahoma", 0, 18));
        magis_lbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        magis_lbl.setText("Madison Automotive Group");
        magis_lbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        magis_lbl.setPreferredSize(new java.awt.Dimension(431, 22));
        header_pnl.add(magis_lbl);

        section_lbl.setText("Section 1 - Group 5");
        header_pnl.add(section_lbl);

        welcom_lbl.setText("|  Welcome: ");
        header_pnl.add(welcom_lbl);
        header_pnl.add(spWelcome_lbl);

        getContentPane().add(header_pnl, java.awt.BorderLayout.NORTH);

        tabNavigation.setPreferredSize(new java.awt.Dimension(20, 50));

        customerTab_pnl.setLayout(new java.awt.BorderLayout());

        customerList_pnl.setBorder(javax.swing.BorderFactory.createTitledBorder("Customer Search"));
        customerList_pnl.setLayout(new java.awt.BorderLayout(5, 5));

        customerList.setPreferredSize(new java.awt.Dimension(168, 80));
        customerList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                customerListValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(customerList);

        customerList_pnl.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        salePrice_txt.setFont(salePrice_txt.getFont().deriveFont(salePrice_txt.getFont().getSize()-2f));
        salePrice_txt.setText("Customer Search");
        salePrice_txt.setPreferredSize(new java.awt.Dimension(125, 17));
        custSearchGroup.add(salePrice_txt);

        addTradeIn_btn1.setFont(new java.awt.Font("Tahoma", 0, 8));
        addTradeIn_btn1.setText("Find");
        addTradeIn_btn1.setAlignmentY(0.0F);
        addTradeIn_btn1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        custSearchGroup.add(addTradeIn_btn1);

        customerList_pnl.add(custSearchGroup, java.awt.BorderLayout.NORTH);

        addCustomer_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        addCustomer_btn.setText("+ Add Customer");
        addCustomer_btn.setAlignmentY(0.0F);
        addCustomer_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addCustomer_btnActionPerformed(evt);
            }
        });
        customerList_pnl.add(addCustomer_btn, java.awt.BorderLayout.PAGE_END);

        customerTab_pnl.add(customerList_pnl, java.awt.BorderLayout.WEST);

        custInfo_pnl.setBorder(javax.swing.BorderFactory.createTitledBorder("Customer Information"));
        custInfo_pnl.setLayout(new java.awt.GridBagLayout());

        fname_lbl.setText("First Name:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(fname_lbl, gridBagConstraints);

        fname_txt.setToolTipText("");
        fname_txt.setPreferredSize(new java.awt.Dimension(125, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(fname_txt, gridBagConstraints);

        lname_lbl.setText("Last Name:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(lname_lbl, gridBagConstraints);

        lname_txt.setToolTipText("");
        lname_txt.setPreferredSize(new java.awt.Dimension(125, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(lname_txt, gridBagConstraints);

        address_lbl.setText("Address:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(address_lbl, gridBagConstraints);

        address_txt.setPreferredSize(new java.awt.Dimension(125, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(address_txt, gridBagConstraints);

        phone_lbl.setText("Phone:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(phone_lbl, gridBagConstraints);

        phone_tx.setPreferredSize(new java.awt.Dimension(125, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(phone_tx, gridBagConstraints);

        highPrice_lbl.setText("High Price:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(highPrice_lbl, gridBagConstraints);

        highPrice_txt.setPreferredSize(new java.awt.Dimension(125, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(highPrice_txt, gridBagConstraints);

        lowPrice_lbl.setText("Low Price:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(lowPrice_lbl, gridBagConstraints);

        lowPrice_txt.setPreferredSize(new java.awt.Dimension(125, 20));
        lowPrice_txt.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                lowPrice_txtFocusLost(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(lowPrice_txt, gridBagConstraints);

        saveCustomer_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        saveCustomer_btn.setText("Save");
        saveCustomer_btn.setAlignmentY(0.0F);
        saveCustomer_btn.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        saveCustomer_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveCustomer_btnActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(saveCustomer_btn, gridBagConstraints);

        editCustomer_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        editCustomer_btn.setText("Edit");
        editCustomer_btn.setAlignmentY(0.0F);
        editCustomer_btn.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        editCustomer_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editCustomer_btnActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        custInfo_pnl.add(editCustomer_btn, gridBagConstraints);

        customerTab_pnl.add(custInfo_pnl, java.awt.BorderLayout.CENTER);

        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        makeSale_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        makeSale_btn.setText("Make Sale");
        makeSale_btn.setAlignmentY(0.0F);
        makeSale_btn.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jPanel1.add(makeSale_btn);

        customerTab_pnl.add(jPanel1, java.awt.BorderLayout.SOUTH);

        tabNavigation.addTab("Customers", customerTab_pnl);

        saleTab_pnl.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                saleTab_pnlFocusGained(evt);
            }
        });
        saleTab_pnl.setLayout(new java.awt.BorderLayout());

        carsAndTradeIns.setLayout(new javax.swing.BoxLayout(carsAndTradeIns, javax.swing.BoxLayout.Y_AXIS));

        tradeInsGroup.setBorder(javax.swing.BorderFactory.createTitledBorder("Trade-Ins"));
        tradeInsGroup.setName("customerGroup"); // NOI18N
        tradeInsGroup.setPreferredSize(new java.awt.Dimension(570, 258));
        tradeInsGroup.setLayout(new javax.swing.BoxLayout(tradeInsGroup, javax.swing.BoxLayout.Y_AXIS));

        tradeIns_tbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tradeIns_sp.setViewportView(tradeIns_tbl);

        tradeInsGroup.add(tradeIns_sp);

        removeTradeIn_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        removeTradeIn_btn.setText("- Remove Trade-In");
        jPanel2.add(removeTradeIn_btn);

        addTradeIn_btn2.setFont(new java.awt.Font("Tahoma", 0, 8));
        addTradeIn_btn2.setText("+ Add Trade-In");
        jPanel2.add(addTradeIn_btn2);

        tradeInsGroup.add(jPanel2);

        carsAndTradeIns.add(tradeInsGroup);

        saleCarsGroup.setBorder(javax.swing.BorderFactory.createTitledBorder("Sale Cars"));
        saleCarsGroup.setName("customerGroup"); // NOI18N
        saleCarsGroup.setPreferredSize(new java.awt.Dimension(398, 270));
        saleCarsGroup.setLayout(new javax.swing.BoxLayout(saleCarsGroup, javax.swing.BoxLayout.Y_AXIS));

        saleCars_tbl.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        saleCars_sp.setViewportView(saleCars_tbl);

        saleCarsGroup.add(saleCars_sp);

        addViewWarranty_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        addViewWarranty_btn.setText("Add/View Warranties");
        saleLinesMenu.add(addViewWarranty_btn);

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator1.setPreferredSize(new java.awt.Dimension(2, 19));
        saleLinesMenu.add(jSeparator1);

        removeCar_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        removeCar_btn.setText("- Remove Car");
        saleLinesMenu.add(removeCar_btn);

        addCar_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        addCar_btn.setText("+ Add Car");
        addCar_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addCar_btnActionPerformed(evt);
            }
        });
        saleLinesMenu.add(addCar_btn);

        saleCarsGroup.add(saleLinesMenu);

        carsAndTradeIns.add(saleCarsGroup);

        saleTab_pnl.add(carsAndTradeIns, java.awt.BorderLayout.CENTER);

        custAndSalesperson.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        customerGroup.setBorder(javax.swing.BorderFactory.createTitledBorder("Customer"));
        customerGroup.setName("customerGroup"); // NOI18N
        customerGroup.setLayout(new java.awt.GridBagLayout());

        custName.setFont(new java.awt.Font("Tahoma", 0, 10));
        custName.setText("Brady White");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        customerGroup.add(custName, gridBagConstraints);

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 8));
        jButton1.setText("Select Customer");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 0);
        customerGroup.add(jButton1, gridBagConstraints);

        custPhone_lbl.setFont(new java.awt.Font("Tahoma", 0, 10));
        custPhone_lbl.setText("801-361-0903");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        customerGroup.add(custPhone_lbl, gridBagConstraints);

        custAndSalesperson.add(customerGroup);

        salespersonGroup.setBorder(javax.swing.BorderFactory.createTitledBorder("Salesperson"));
        salespersonGroup.setName("customerGroup"); // NOI18N
        salespersonGroup.setLayout(new java.awt.GridBagLayout());

        spName_lbl.setFont(new java.awt.Font("Tahoma", 0, 10));
        spName_lbl.setText("Dustin Graham");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        salespersonGroup.add(spName_lbl, gridBagConstraints);

        selectSalesperson_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        selectSalesperson_btn.setText("Select Salesperson");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        salespersonGroup.add(selectSalesperson_btn, gridBagConstraints);

        spId_lbl.setFont(new java.awt.Font("Tahoma", 0, 10));
        spId_lbl.setText("                   ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
        salespersonGroup.add(spId_lbl, gridBagConstraints);

        custAndSalesperson.add(salespersonGroup);

        saleTab_pnl.add(custAndSalesperson, java.awt.BorderLayout.NORTH);

        saleMenu.setPreferredSize(new java.awt.Dimension(250, 30));
        saleMenu.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        cancel_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        cancel_btn.setText("Cancel");
        saleMenu.add(cancel_btn);

        saveSale_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        saveSale_btn.setText("Save Sale");
        saleMenu.add(saveSale_btn);

        saleTab_pnl.add(saleMenu, java.awt.BorderLayout.SOUTH);

        salesTotal.setBorder(javax.swing.BorderFactory.createTitledBorder("Sales Total"));
        salesTotal.setPreferredSize(new java.awt.Dimension(200, 200));
        salesTotal.setLayout(new javax.swing.BoxLayout(salesTotal, javax.swing.BoxLayout.LINE_AXIS));

        saleTotals_scrollPane.setPreferredSize(new java.awt.Dimension(250, 402));

        saleTotals_jtable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        saleTotals_jtable.setPreferredSize(new java.awt.Dimension(150, 64));
        saleTotals_scrollPane.setViewportView(saleTotals_jtable);

        salesTotal.add(saleTotals_scrollPane);

        saleTab_pnl.add(salesTotal, java.awt.BorderLayout.EAST);

        tabNavigation.addTab("Create Sale", saleTab_pnl);

        serviceTab_pnl.setLayout(new java.awt.BorderLayout());

        custAndTech_pnl.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        custService_Info.setBorder(javax.swing.BorderFactory.createTitledBorder("Customer"));
        custService_Info.setPreferredSize(new java.awt.Dimension(250, 64));
        custService_Info.setLayout(new java.awt.GridBagLayout());

        custService_lbl.setText("Adam Chavez");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.ipadx = 11;
        custService_Info.add(custService_lbl, gridBagConstraints);

        custServicePhone_lbl.setText("801-687-1401");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 9;
        custService_Info.add(custServicePhone_lbl, gridBagConstraints);

        changeServiceCust_lbl.setText("Change Customer");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.ipadx = 8;
        custService_Info.add(changeServiceCust_lbl, gridBagConstraints);

        custAndTech_pnl.add(custService_Info);
        custAndTech_pnl.add(jPanel5);

        techInfo_pnl.setBorder(javax.swing.BorderFactory.createTitledBorder("Technician"));
        techInfo_pnl.setLayout(new java.awt.GridBagLayout());

        techName_lbl.setText("Jason Whiting");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.ipadx = 61;
        gridBagConstraints.insets = new java.awt.Insets(4, 7, 4, 7);
        techInfo_pnl.add(techName_lbl, gridBagConstraints);

        jLabel1.setText("                                ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        techInfo_pnl.add(jLabel1, gridBagConstraints);

        custAndTech_pnl.add(techInfo_pnl);

        serviceTab_pnl.add(custAndTech_pnl, java.awt.BorderLayout.NORTH);

        saleMenu1.setPreferredSize(new java.awt.Dimension(250, 30));
        saleMenu1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        cancelService_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        cancelService_btn.setText("Cancel");
        saleMenu1.add(cancelService_btn);

        saveService_btn.setFont(new java.awt.Font("Tahoma", 0, 8));
        saveService_btn.setText("Save Service");
        saleMenu1.add(saveService_btn);

        serviceTab_pnl.add(saleMenu1, java.awt.BorderLayout.SOUTH);

        vehicleAndTask.setMinimumSize(new java.awt.Dimension(200, 500));
        vehicleAndTask.setPreferredSize(new java.awt.Dimension(971, 1000));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Vehicle Selection"));

        custVehicleSelect_cbo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Honda, Accord 2003", "Toyota, Supra 1998", "Dodge, Charger 1976", "Chevrolet, Corvette 2010" }));
        custVehicleSelect_cbo.setPreferredSize(new java.awt.Dimension(90, 20));

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(custVehicleSelect_cbo, 0, 135, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(custVehicleSelect_cbo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        summaryPanel_pnl.setBorder(javax.swing.BorderFactory.createTitledBorder("Service Detail"));
        summaryPanel_pnl.setMinimumSize(new java.awt.Dimension(427, 1000));
        summaryPanel_pnl.setPreferredSize(new java.awt.Dimension(450, 800));

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel4.setPreferredSize(new java.awt.Dimension(450, 140));

        jLabel2.setText("Brake Replacement");

        jLabel3.setText("Total Labor:");

        jTextField1.setText("2");

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel7.setText("$256.75");

        jLabel11.setText("Subtotal:");

        jButton2.setText("-");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "brake pad", "brake fluid", "transfer case", "timing belt" }));

        jButton4.setText("+");

        jLabel6.setText("brake pad:");

        jTextField4.setText("4");

        jLabel8.setText("brake fluid:");

        jTextField5.setText("1");

        jLabel14.setText("$20.00");

        jLabel15.setText("$66.75");

        jLabel16.setText("$170.00");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel8)
                    .addComponent(jLabel6)
                    .addComponent(jLabel3)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTextField4, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTextField5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jButton4)
                        .addGap(35, 35, 35)
                        .addComponent(jLabel11)
                        .addGap(34, 34, 34)
                        .addComponent(jLabel7))
                    .addComponent(jLabel14)
                    .addComponent(jLabel15)
                    .addComponent(jLabel16))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16)))
                    .addComponent(jButton2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jLabel11)))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel8.setPreferredSize(new java.awt.Dimension(450, 140));

        jLabel17.setText("Transmission Job");

        jLabel22.setText("Total Labor:");

        jTextField6.setText("8");

        jLabel23.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel23.setText("$900.00");

        jLabel24.setText("Subtotal:");

        jButton5.setText("-");

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "brake pad", "brake fluid", "transfer case", "timing belt" }));

        jButton8.setText("+");

        jLabel25.setText("Transfer case:");

        jTextField7.setText("1");

        jLabel26.setText("timing belt:");

        jTextField8.setText("1");

        jLabel27.setText("$20.00");

        jLabel28.setText("$200.00");

        jLabel29.setText("$680.00");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel26)
                    .addComponent(jLabel25)
                    .addComponent(jLabel22)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jButton5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jTextField6, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTextField7, javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jTextField8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE))
                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton8))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(106, 106, 106)
                        .addComponent(jLabel24)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel23, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel27)
                            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabel29, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel22)
                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel29)))
                    .addComponent(jButton5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(jLabel23)))
        );

        javax.swing.GroupLayout summaryPanel_pnlLayout = new javax.swing.GroupLayout(summaryPanel_pnl);
        summaryPanel_pnl.setLayout(summaryPanel_pnlLayout);
        summaryPanel_pnlLayout.setHorizontalGroup(
            summaryPanel_pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(summaryPanel_pnlLayout.createSequentialGroup()
                .addGroup(summaryPanel_pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.LEADING, 0, 469, Short.MAX_VALUE)
                    .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE))
                .addContainerGap(15, Short.MAX_VALUE))
        );
        summaryPanel_pnlLayout.setVerticalGroup(
            summaryPanel_pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(summaryPanel_pnlLayout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(99, Short.MAX_VALUE))
        );

        carDisplay_pnl.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        carDisplay_pnl.setLayout(new java.awt.GridBagLayout());

        custCarMakeDisplay_lbl.setText("Honda");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 16;
        carDisplay_pnl.add(custCarMakeDisplay_lbl, gridBagConstraints);

        custCarVin_lbl.setText("VIN:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        carDisplay_pnl.add(custCarVin_lbl, gridBagConstraints);

        custCarYearDisplay_lbl.setText("2003");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        carDisplay_pnl.add(custCarYearDisplay_lbl, gridBagConstraints);

        custCarMake_lbl.setText("Make:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 13;
        carDisplay_pnl.add(custCarMake_lbl, gridBagConstraints);

        custCarYear_lbl.setText("Year:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        carDisplay_pnl.add(custCarYear_lbl, gridBagConstraints);

        custCarModelDisplay_lbl.setText("Accord");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        carDisplay_pnl.add(custCarModelDisplay_lbl, gridBagConstraints);

        custCarModel_lbl.setText("Model:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 3;
        carDisplay_pnl.add(custCarModel_lbl, gridBagConstraints);

        custCarVinDisplay_lbl.setText("12345678901234567");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        carDisplay_pnl.add(custCarVinDisplay_lbl, gridBagConstraints);

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Service Task Selection"));

        serviceTaskSelect_cbo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Brake Job", "Lube Job", "Tire Rotation", "Spark Plugs", " " }));

        jButton3.setText("+");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addComponent(serviceTaskSelect_cbo, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton3)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(5, 5, 5)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(serviceTaskSelect_cbo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3))
                .addContainerGap(40, Short.MAX_VALUE))
        );

        grand_total_pnl.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel12.setText("$1156.75");

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel13.setText("Grand Total: ");

        javax.swing.GroupLayout grand_total_pnlLayout = new javax.swing.GroupLayout(grand_total_pnl);
        grand_total_pnl.setLayout(grand_total_pnlLayout);
        grand_total_pnlLayout.setHorizontalGroup(
            grand_total_pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, grand_total_pnlLayout.createSequentialGroup()
                .addContainerGap(503, Short.MAX_VALUE)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addGap(24, 24, 24))
        );
        grand_total_pnlLayout.setVerticalGroup(
            grand_total_pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, grand_total_pnlLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(grand_total_pnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jLabel13))
                .addContainerGap())
        );

        javax.swing.GroupLayout vehicleAndTaskLayout = new javax.swing.GroupLayout(vehicleAndTask);
        vehicleAndTask.setLayout(vehicleAndTaskLayout);
        vehicleAndTaskLayout.setHorizontalGroup(
            vehicleAndTaskLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, vehicleAndTaskLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(vehicleAndTaskLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(grand_total_pnl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(vehicleAndTaskLayout.createSequentialGroup()
                        .addGroup(vehicleAndTaskLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(carDisplay_pnl, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(summaryPanel_pnl, javax.swing.GroupLayout.PREFERRED_SIZE, 496, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addGap(292, 292, 292))
        );
        vehicleAndTaskLayout.setVerticalGroup(
            vehicleAndTaskLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(vehicleAndTaskLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(vehicleAndTaskLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(vehicleAndTaskLayout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(carDisplay_pnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(summaryPanel_pnl, javax.swing.GroupLayout.PREFERRED_SIZE, 487, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(grand_total_pnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(52, 52, 52))
        );

        serviceTab_pnl.add(vehicleAndTask, java.awt.BorderLayout.CENTER);

        tabNavigation.addTab("Service", serviceTab_pnl);

        getContentPane().add(tabNavigation, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void lowPrice_txtFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_lowPrice_txtFocusLost

}//GEN-LAST:event_lowPrice_txtFocusLost

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        // TODO add your handling code here:        
        try{
        Model.getInstance().sale = SaleDAO.getInstance().create(Model.getInstance().employee.getId());
        }catch(Exception e){
            try {
                throw new DataException("could not initiate a sale object", e);
            } catch (DataException ex) {
                Logger.getLogger(Magis1.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_formWindowOpened

    private void addCustomer_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addCustomer_btnActionPerformed
        //addNewCustDialog dialog = new addNewCustDialog(customerListModel);
        //dialog.setVisible(true);
        editState = true;
        this.setEditState();
        editCustomer_btn.setText("Cancel");
}//GEN-LAST:event_addCustomer_btnActionPerformed

    private void editCustomer_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editCustomer_btnActionPerformed
        // TODO add your handling code here:
        if(editCustomer_btn.getText().equals("Cancel")){
            this.clearEditFields();
            editState = false;
            this.setEditState();
            editCustomer_btn.setText("Edit");
            return;
        } 
        if(editState == false){
            editState = true;
            this.setEditState();
            editCustomer_btn.setText("Cancel");
        }
        else{
            editState = false;
            this.setEditState();
            editCustomer_btn.setText("Edit");
        }
                       
    }//GEN-LAST:event_editCustomer_btnActionPerformed

    private void customerListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_customerListValueChanged
        // TODO add your handling code here:
        Customer cust = custList.get(customerList.getSelectedIndex());
        Model.getInstance().customer = cust;
        this.setCustomerFields(cust);        
}//GEN-LAST:event_customerListValueChanged

    private void saveCustomer_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveCustomer_btnActionPerformed
        try {
            // get the values from the text fields
            //call the customer DAO save methods,
            Customer cust = CustomerDAO.getInstance().create(GUID.generate());
            cust.setFirstName(fname_txt.getText());
            cust.setLastName(lname_txt.getText());
            cust.setAddress(address_txt.getText());
            cust.setPhone(phone_tx.getText());
            cust.setHighPrice(Double.parseDouble(highPrice_txt.getText()));
            cust.setLowPrice(Double.parseDouble(lowPrice_txt.getText()));
            CustomerDAO.getInstance().save(cust);
            this.reloadCustomerList();
            this.clearEditFields();
            editState = false;
            this.setEditState();
        } catch (DataException ex) {
            Logger.getLogger(Magis1.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_saveCustomer_btnActionPerformed

    private void saleTab_pnlFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_saleTab_pnlFocusGained
        // TODO add your handling code here:
        custName.setText(" nothing");
    }//GEN-LAST:event_saleTab_pnlFocusGained

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        final JButton button = new JButton("Service" + ServiceItemCounter);
        this.ServiceButtonSelected = button.getText();  
        button.setName("" + ServiceItemCounter);
        this.tempButton = button;
        serviceItemList.add(button);
        summaryPanel_pnl.add(button);
        summaryPanel_pnl.validate();
        
        ServiceItemCounter += 1;
        
        button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RemoveTaskEvent myEvent = new RemoveTaskEvent(evt.getSource(), evt.getID(), evt.getActionCommand(), button);
                ServiceButtonActionlistener(myEvent);
            }
        });
        
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        serviceTab_pnl.setVisible(false);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void addCar_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addCar_btnActionPerformed
         //TODO add your handling code here:
        try{
        new newSL(this,true).setVisible(true);
        }catch(Exception e){
            e.printStackTrace();
        }
        //String vin = JOptionPane.showInputDialog(this, "Please enter the 17 digit VIN: ");
    }//GEN-LAST:event_addCar_btnActionPerformed

    private void ServiceButtonActionlistener(RemoveTaskEvent evt) {
        serviceItemList.remove(evt.button);
        summaryPanel_pnl.remove(evt.button);
        summaryPanel_pnl.repaint();
        //JOptionPane.showConfirmDialog(this, "got to the listener");
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {           
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                
                //new Magis().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addCar_btn;
    private javax.swing.JButton addCustomer_btn;
    private javax.swing.JButton addTradeIn_btn1;
    private javax.swing.JButton addTradeIn_btn2;
    private javax.swing.JButton addViewWarranty_btn;
    private javax.swing.JLabel address_lbl;
    private javax.swing.JFormattedTextField address_txt;
    private javax.swing.JButton cancelService_btn;
    private javax.swing.JButton cancel_btn;
    private javax.swing.JPanel carDisplay_pnl;
    private javax.swing.JPanel carsAndTradeIns;
    private javax.swing.JButton changeServiceCust_lbl;
    private javax.swing.JPanel custAndSalesperson;
    private javax.swing.JPanel custAndTech_pnl;
    private javax.swing.JLabel custCarMakeDisplay_lbl;
    private javax.swing.JLabel custCarMake_lbl;
    private javax.swing.JLabel custCarModelDisplay_lbl;
    private javax.swing.JLabel custCarModel_lbl;
    private javax.swing.JLabel custCarVinDisplay_lbl;
    private javax.swing.JLabel custCarVin_lbl;
    private javax.swing.JLabel custCarYearDisplay_lbl;
    private javax.swing.JLabel custCarYear_lbl;
    private javax.swing.JPanel custInfo_pnl;
    private javax.swing.JLabel custName;
    private javax.swing.JLabel custPhone_lbl;
    private javax.swing.JPanel custSearchGroup;
    private javax.swing.JLabel custServicePhone_lbl;
    private javax.swing.JPanel custService_Info;
    private javax.swing.JLabel custService_lbl;
    private javax.swing.JComboBox custVehicleSelect_cbo;
    private javax.swing.JPanel customerGroup;
    private javax.swing.JList customerList;
    private javax.swing.JPanel customerList_pnl;
    private javax.swing.JPanel customerTab_pnl;
    private javax.swing.JButton editCustomer_btn;
    private javax.swing.JLabel fname_lbl;
    private javax.swing.JFormattedTextField fname_txt;
    private javax.swing.JPanel grand_total_pnl;
    private javax.swing.JPanel header_pnl;
    private javax.swing.JLabel highPrice_lbl;
    private javax.swing.JFormattedTextField highPrice_txt;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton8;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JLabel lname_lbl;
    private javax.swing.JFormattedTextField lname_txt;
    private javax.swing.JLabel lowPrice_lbl;
    private javax.swing.JFormattedTextField lowPrice_txt;
    private javax.swing.JLabel magis_lbl;
    private javax.swing.JButton makeSale_btn;
    private javax.swing.JLabel phone_lbl;
    private javax.swing.JFormattedTextField phone_tx;
    private java.awt.PopupMenu popupMenu1;
    private javax.swing.JButton removeCar_btn;
    private javax.swing.JButton removeTradeIn_btn;
    private javax.swing.JPanel saleCarsGroup;
    private javax.swing.JScrollPane saleCars_sp;
    private javax.swing.JTable saleCars_tbl;
    private javax.swing.JPanel saleLinesMenu;
    private javax.swing.JPanel saleMenu;
    private javax.swing.JPanel saleMenu1;
    private javax.swing.JTextField salePrice_txt;
    private javax.swing.JPanel saleTab_pnl;
    private javax.swing.JTable saleTotals_jtable;
    private javax.swing.JScrollPane saleTotals_scrollPane;
    private javax.swing.JPanel salesTotal;
    private javax.swing.JPanel salespersonGroup;
    private javax.swing.JButton saveCustomer_btn;
    private javax.swing.JButton saveSale_btn;
    private javax.swing.JButton saveService_btn;
    private javax.swing.JLabel section_lbl;
    private javax.swing.JButton selectSalesperson_btn;
    private javax.swing.JPanel serviceTab_pnl;
    private javax.swing.JComboBox serviceTaskSelect_cbo;
    private javax.swing.JLabel spId_lbl;
    private javax.swing.JLabel spName_lbl;
    private javax.swing.JLabel spWelcome_lbl;
    private javax.swing.JPanel summaryPanel_pnl;
    private javax.swing.JTabbedPane tabNavigation;
    private javax.swing.JPanel techInfo_pnl;
    private javax.swing.JLabel techName_lbl;
    private javax.swing.JPanel tradeInsGroup;
    private javax.swing.JScrollPane tradeIns_sp;
    private javax.swing.JTable tradeIns_tbl;
    private javax.swing.JPanel vehicleAndTask;
    private javax.swing.JLabel welcom_lbl;
    // End of variables declaration//GEN-END:variables

}
